package com.job.sun;

import com.sun.xml.internal.ws.runtime.config.TubelineFeatureReader;

import java.util.Scanner;

/**
 * @author 张春阳
 * @version 1.0
 * @since 2022-07-14 21:34:46
 */
public class UseSystem {

    public static void main(String[] args) {
        //1. 复制
        int[] str1 = new int[]{1, 2, 3, 4, 5, 6};
        int[] str2 = new int[6];
        System.arraycopy(str1, 2, str2, 2, 4);
        for (int i = 2; i < 6; i++) {
            System.out.println(str2[i]);
        }
        //2.exit
//        System.out.println("请输入暗号");
//        Scanner sc = new Scanner(System.in);
//        while (true){
//            String next = sc.next();
//            if (next.equals("0")){
//                System.exit(0);
//            }else {
//
//                System.out.println("暗号错误");
//            }
//        }
        //3.系统
        System.out.println(System.getProperty("os.name"));
        System.out.println(System.getProperty("os.version"));
        //4.获取环境变量
        System.out.println(System.getenv("JAVA_HOME"));
        //5.时间
        long t1 = System.currentTimeMillis();
        String str = "A";
        for (int i = 0; i <= 100000; i++) {
            str += i;
        }
        long t2 = System.currentTimeMillis();
        System.out.println("for循环运行的时间是"+(t2-t1));
    }

}